#ifndef RECORDDETAIL_H
#define RECORDDETAIL_H

#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QHBoxLayout>
#include <QPropertyAnimation>
#include "record.h"


class RecordDetail : public QWidget
{
    Q_OBJECT
public:
    explicit RecordDetail(QWidget *parent = nullptr);


private:
    QLabel* nameLabel;
    QLabel* shortNameLabel;
    QLabel* makeAtLabel;
    QLabel* vailAtLabel;
    QLabel* remarkLabel;
    QLabel* saveTypeLabel;
    QLabel* standradLabel;
    QLabel* hasPartLabel;
    QLabel* statusLabel;
    QPushButton* reprintButton;
    QPushButton* splitButton;
    QPushButton* expiredButton;

    QPropertyAnimation *reprintColorAnim;
    QPropertyAnimation *splitColorAnim;
    QPropertyAnimation *expiredColorAnim;


    Record* record;

    void setupConnections();
    void applyStyles();
    void loadDetail();
    QHBoxLayout* createLabelLine(QString title, QLabel* content);
    QPropertyAnimation* createButtonAnimation(QPushButton* button);

private slots:
    void recordUpdate(Record* r);
    void reprint();
    void split();
    void expired();

signals:
};

#endif // RECORDDETAIL_H
